from django.contrib import admin
from course.models import CourseDirectionModel,CourseCategoryModel,CourseModel,TeacherModel,\
ActivateModel,DiscountModel,DiscountTypeModel,CourseActivateModel
# Register your models here.
# 方向列表/专业列表
class CourseDirectionModelAdmin(admin.ModelAdmin):
    list_display = ['id','name','recomment_home_hot','recomment_home_top']
admin.site.register(CourseDirectionModel,CourseDirectionModelAdmin)
# 课程分类
class CourseCategoryModelAdmin(admin.ModelAdmin):
    list_display = ['id', 'name', 'remark', 'diretion']
admin.site.register(CourseCategoryModel,CourseCategoryModelAdmin)
# 课程模型类
class CourseModelAdmin(admin.ModelAdmin):
    list_display = ['id', 'name', 'price', 'category','direction']
admin.site.register(CourseModel,CourseModelAdmin)
# 老师模型类
class TeacherModelAdmin(admin.ModelAdmin):
    list_display = ['id','avatar_small', 'name', 'title', 'signature']
admin.site.register(TeacherModel,TeacherModelAdmin)


#-----------------------------优惠活动管理站点配置------------------------

# 需要关联课程活动表
# 等待
class ActivateModelAdmin(admin.ModelAdmin):
    list_display = ['id','name','start_time','end_time']

admin.site.register(ActivateModel,ActivateModelAdmin)


# 折扣类型
class DiscountTypeAdmin(admin.ModelAdmin):
    list_display = ['id','name','remark']

admin.site.register(DiscountTypeModel,DiscountTypeAdmin)


# 折扣
class DiscountAdmin(admin.ModelAdmin):
    list_display = ['id','name','discount_type','condition','sale']

admin.site.register(DiscountModel,DiscountAdmin)


# 课程活动价格表
class CourseActivateAdmin(admin.ModelAdmin):
    list_display = ['id','activate','course','discount']

admin.site.register(CourseActivateModel,CourseActivateAdmin)




























